package test;

import static org.junit.Assert.*;

import java.net.InetAddress;
import java.net.UnknownHostException;

import org.junit.Test;

public class Domain2Ip {

	@Test
	public void test() throws UnknownHostException {
		InetAddress[] ips = InetAddress.getAllByName("www.baidu.com");
		for (InetAddress ip : ips) {
			System.out.println(ip.toString());
			System.out.println("Address:  " + ip.getHostAddress());
			System.out.println("Name: " + ip.getHostName());
		}
		
		
	}
}
